package nancal.mp.db.mongo.entity.admin

import nbcp.base.db.annotation.Cn
import nbcp.base.db.annotation.DbEntityGroup
import nbcp.base.db.annotation.DbEntityIndex
import nbcp.base.db.annotation.DbEntityIndexes
import nbcp.myoql.db.mongo.entity.BasicUserLoginInfo
import org.springframework.data.mongodb.core.mapping.Document
import java.time.LocalDate

/**
 * 平台员工登录用户
 */
@Document
@DbEntityGroup("admin")
@DbEntityIndexes(DbEntityIndex("loginName", unique = true))
data class AdminLoginUser(
    var errorLoginTimes: Byte = 0,
    @Cn("google验证器密钥")
    var totpKey: String = "",

    /**
     * 一次性MFA验证码
     */
    var mfa1: String = "",
    var mfa1ExpireAt: LocalDate? = null
) : BasicUserLoginInfo()